import request from '@/utils/request';

// 查询订单列表
export function listOrder(query) {
	return request({
		url: '/mall/order/list',
		method: 'post',
		data: query,
	});
}

export function rechargeList(query) {
	return request({
		url: '/mall/order/rechargeList',
		method: 'post',
		data: query,
	});
}
export function listOrderSupplier(query) {
	return request({
		url: '/mall/supplier-order/list',
		method: 'post',
		data: query,
	});
}

// 查询订单详细
export function getOrder(id) {
	return request({
		url: '/mall/order/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增订单
export function addOrder(data) {
	return request({
		url: '/mall/order/add',
		method: 'post',
		data: data,
	});
}

// 编辑订单
export function updateOrder(data) {
	return request({
		url: '/mall/order/edit',
		method: 'post',
		data: data,
	});
}

// 删除订单
export function delOrder(id) {
	return request({
		url: '/mall/order/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出订单
export function exportOrder(query) {
	return request({
		url: '/mall/order/export',
		method: 'post',
		params: query,
	});
}
// 订单详情
export function getOrderDetails(id, orderGoodId) {
	return request({
		url: '/mall/order/getInfo',
		method: 'post',
		data: { id: id, goodId: orderGoodId },
	});
}

// 订单发货
export function ship(data) {
	return request({
		url: '/mall/order/ship',
		method: 'post',
		data: data,
	});
}

// 最新订单
export function newOrder(data) {
	return request({
		url: '/mall/order/newOrder',
		method: 'post',
		data: data,
	});
}
export function checkNum(data) {
	return request({
		url: '/system/selfmentionOrder/check',
		method: 'post',
		data: data,
	});
}
export function checkNum2(data) {
	return request({
		url: '/mall/order/check',
		method: 'post',
		data: data,
	});
}
export function goShip(data) {
	return request({
		url: '/mall/order/ship',
		method: 'post',
		data: data,
	});
}
export function supplierShipList(data) {
	return request({
		url: '/mall/supplier-order/list',
		method: 'post',
		data: data,
	});
}
export function aftersaleList(data) {
	return request({
		url: '/mall/aftersale/list',
		method: 'post',
		data: data,
	});
}
export function auditAftersale(data) {
	return request({
		url: '/mall/aftersale/edit',
		method: 'post',
		data: data,
	});
}

export function auditAftersaleV2(data) {
	return request({
		url: '/mall/aftersale/audit',
		method: 'post',
		data: data,
	});
}
export function refuseAftersale(data) {
	return request({
		url: '/mall/aftersale/refuse',
		method: 'post',
		data: data,
	});
}
export function exportAftersale(data) {
	return request({
		url: '/mall/aftersale/export',
		method: 'post',
		data: data,
	});
}

export function getShipAddress() {
	return request({
		url: '/mall/aftersale/get-address',
		method: 'get',
	});
}

export function auditShipAddress(data) {
	return request({
		url: '/mall/aftersale/edit-address',
		method: 'post',
		data: data,
	});
}

export function addShipAddress(data) {
	return request({
		url: '/mall/aftersale/ship-address',
		method: 'post',
		data: data,
	});
}

export function listOrderStore(query) {
	return request({
		url: '/mall/store-order/list',
		method: 'post',
		data: query,
	});
}

export function exportTotal() {
	return request({
		url: '/mall/order/exportTotal',
		method: 'post',
		// data: data,
	});
}
